<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<c:if test="${initParam['ssoEnable']=='true'}">
    <%@ include file="/WEB-INF/jsp/manage/common/ssoInclude.jsp" %>
</c:if>

<script type="text/javascript">
    $(function () {
        $.acooly.framework.registerKeydown('manage_merchant_account_searchform', 'manage_merchant_account_datagrid');
    });
</script>
<div class="easyui-layout" data-options="fit : true,border : false">
    <div data-options="region:'north',border:false" style="padding:5px; overflow: hidden;" align="left">
        <div id="manage_merchant_account_search">
            <form id="manage_merchant_account_searchform" onsubmit="return false">
                <table class="tableForm" width="100%">
                    <tr>
                        <td align="left">
                            <div>
                                时间范围: <input size="15" class="text" id="startTime"
                                             name="startTime"
                                             onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})"/>
                                至<input size="15" class="text" id="endTime" name="endTime"
                                        onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})"/>
                                <a href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:false"
                                   onclick="$.acooly.framework.search('manage_merchant_account_searchform','manage_merchant_account_datagrid');"><i
                                        class="fa fa-search fa-lg fa-fw fa-col"></i>查询</a>
                            </div>
                        </td>
                    </tr>
                </table>
            </form>
        </div>

        <table class="tableForm" cellpadding="1" cellspacing="1" width="100%">
            <tr>
                <td>商户名：${merchant.merchantName}</td>
                <td>测试商户</td>
                <td>商户ID：</td>
                <td id="merchantId">${merchant.merchantId}</td>
                <td>商户资金账户：</td>
                <td id="accountNo">${merchant.accountNo}</td>
            </tr>
            <tr>
                <td>余额：</td>
                <td id="bleBalance">${accountInfo.balance.toCNString()}</td>
                <td>可用余额：</td>
                <td id="availableBalance">${accountInfo.balance.subtract(accountInfo.freezeAmount).toCNString()}</td>
                <td>冻结金额：</td>
                <td id="freezeBalance">${accountInfo.freezeAmount.toCNString()}</td>
            </tr>
            <%--<tr>--%>
                <%--<td rowspan="4">交易明细</td>--%>
                <%--<td>充值</td>--%>
                <%--<td>提现</td>--%>
                <%--<td class="last">转账支出</td>--%>
                <%--<td>转账收入</td>--%>
            <%--</tr>--%>
            <%--<tr>--%>
                <%--<td id="deposit">${Statistics != ''?Statistics:"没有纸"}</td>--%>
                <%--<td id="withDraw">0.00</td>--%>
                <%--<td id="transfer_out">0.00</td>--%>
                <%--<td class="last" id="transfer_int">0.00</td>--%>
            <%--</tr>--%>
        </table>
    </div>

    <div data-options="region:'center',border:false">

        <table id="manage_merchant_account_datagrid" class="easyui-datagrid"
               url="${pageContext.request.contextPath}/manage/merchant/merchant/queryFinanceJson.html?merchantId=${merchant.merchantId}"
               toolbar="#manage_merchant_toolbar" fit="true" border="false" fitColumns="false"
               pagination="true" idField="id" pageSize="20" pageList="[ 10, 20, 30, 40, 50 ]" sortName="id"
               sortOrder="desc" checkOnSelect="true" selectOnCheck="true" singleSelect="true">
            <thead>
            <tr>
                <th field="showCheckboxWithId" checkbox="true"
                    data-options="formatter:function(value, row, index){ return row.id }">编号
                </th>
                <th field="id" sum="true">id</th>
                <th field="account">资金账户</th>
                <th field="bizNo">资金流水号</th>
                <th field="bizOrderNo">交易流水号</th>
                <th field="transType">交易类型</th>
                <th field="direction">资金方向</th>
                <th field="transAmount">交易金额</th>
                <th field="balance">账户余额</th>
                <th field="createTime" formatter="formatDate">添加时间</th>
                <th field="updateTime" formatter="formatDate">更新时间</th>
            </tr>
            </thead>
        </table>

        <div id="manage_merchant_toolbar">
            <a href="#" class="easyui-linkbutton" plain="true"
               onclick="$.acooly.framework.show('/manage/merchant/merchant/${merchantTag == 'agentAccount'? 'agentShow.html':'normalShow.html'}?id=${merchant.id}',500,400);"><i
                    class="fa fa-file-o fa-lg fa-fw fa-col"></i>查看商户信息</a>
            <a href="#" class="easyui-linkbutton" plain="true"
               onclick="$.acooly.framework.edit({url:'/manage/merchant/merchant/${merchantTag == 'agentAccount'?'agentAccountEdit.html':'normalAccountEdit.html'}',id:'${merchant.id}',entity:'merchant',width:500,height:400});"><i
                    class="fa fa-pencil fa-lg fa-fw fa-col"></i>修改商户信息</a>
            <a href="#" class="easyui-menubutton" data-options="menu:'#manage_merchant_account_withdraw_menu'"><i
                    class="fa fa-money fa-lg fa-fw fa-col"></i>资金操作</a>
            <div id="manage_merchant_account_withdraw_menu" style="width:150px;">
                <div onclick="$.acooly.framework.edit({url:'/manage/merchant/merchant/accountWithdraw.html',id:'${merchant.merchantId}',title:'提现申请',editButton:'提现',entity:'merchant_account_withdraw',width:500,height:400});">
                    <i class="fa fa-money fa-lg fa-fw fa-col"></i>提现
                </div>
            </div>

            <a href="#" class="easyui-menubutton" data-options="menu:'#manage_merchant_exports_menu'"><i
                    class="fa fa-arrow-circle-o-down fa-lg fa-fw fa-col"></i>批量导出资金明细</a>
            <div id="manage_merchant_exports_menu" style="width:150px;">
                <div onclick="$.acooly.framework.exports('/manage/merchant/merchant/exportXls.html','manage_merchant_account_searchform','merchant_account')">
                    <i class="fa fa-file-excel-o fa-lg fa-fw fa-col"></i>Excel
                </div>
                <div onclick="$.acooly.framework.exports('/manage/merchant/merchant/exportCsv.html','manage_merchant_account_searchform','merchant_account')">
                    <i class="fa fa-file-text-o fa-lg fa-fw fa-col"></i>CSV
                </div>
            </div>
        </div>
    </div>
</div>
